package trafficgeneratorcr.algo;

public class NormalisationAlgorithm {

    private double[] inputPoints;
    private double[] outputPoints;

    public NormalisationAlgorithm(double[] inputPoints) {
        this.inputPoints = inputPoints;
        this.outputPoints = new double[inputPoints.length];
    }

    public double[] getOutputPoints() {
        return outputPoints;
    }

    public void execute() {
        int sum = 0;
        for (int i = 0; i < inputPoints.length; i++) {
            sum += inputPoints[i];
        }
    
        for (int i = 0; i < inputPoints.length; i++) {
            outputPoints[i] = (double) inputPoints[i] / sum;
        }
    }

}
